var vo={};
$(function(){
	var openWindow=window.document;
	var searchHeight=$("#divform").height();
	$("#listOplog").height($(openWindow).height()-searchHeight);
	//动态设置改变操作列宽度
	$("#listOplog").datagrid({
					url:'/user/getOplog',
					title:'日志列表',
					method:'get',
					pagination:true,
					singleSelect:true,
					pageList: window.PageSize,
					loadMsg:'加载中......',
					columns:[[
					         {field:'operatorid',title:'操作员编号', align:'center',width:100,sortable:true},
					         {field:'opname',title:'操作员名称',align:'center',width:80},
					         {field:'menuname',title:'菜单名称',align:'center',width:100},
					         {field:'optime',title:'操作时间',align:'center',width:140,formatter:function(value,row,index){
					        	 var datetime=Common.formatterDate2(value);
					        	 return datetime;
					         }},
					         {field:'model',title:'日志信息',align:'left',width:300},
					     ]]
				});
	$("#serbutton").click(function(){
		vo.operatorid=$("#operatorid").val();
		vo.menuname=$("#menuname").val();
		vo.begintime=$('#beginTime').datetimebox('getValue');
		vo.endtime=$('#endTime').datetimebox('getValue');
		$("#listOplog").datagrid('load',vo);
	});
	$('#beginTime').datetimebox({});  
	$('#endTime').datetimebox({}); 
	//绑定回车事件
	$(document).keydown(function(event){ 
		if(event.keyCode==13){
			$("#serbutton").click(); 
		}
	});
	$("#listOplog").datagrid({
		toolbar: '#tb'
	});
});
/**
 * 导出为excel
 */
function exportXls(){
	vo.operatorid=getVal(vo.operatorid);
	vo.menuname=getVal(vo.menuname);
	vo.begintime=getVal(vo.begintime);
	vo.endtime=getVal(vo.endtime);
	var url='/oplog/exportXls?operatorid='+vo.operatorid+'&menuname='+vo.menuname+'&begintime='+
	vo.begintime+'&endtime='+vo.endtime;
	window.open(url,'','',false);
}